from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
# 导入 app, db 实例
from info import create_app, db
# 在数据库中导入数据表
from info.models import *

# 调用函数, 创建app实例
app = create_app('develop')

# 6> 命令行运行项目
manager = Manager(app)

# 7> 讲数据库迁移命令添加至命令行
migrate = Migrate(app, db)
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    manager.run()
